package bai5.model;

import java.util.Scanner;

public class Materials {
	private String ten;
	private String loai;
	private int soluong;

	private int gia;
	public Materials(){
		
	}
	public Materials(String ten, String loai, int soluong,int gia) {
		super();
		this.ten = ten;
		this.loai = loai;
		this.soluong = soluong;
		this.gia = gia;
	}
	public String getTen() {
		return ten;
	}
	public void setTen(String ten) {
		this.ten = ten;
	}
	public String getLoai() {
		return loai;
	}
	public void setLoai(String loai) {
		this.loai = loai;
	}
	public int getSoluong() {
		return soluong;
	}
	public void setSoluong(int soluong) {
		this.soluong = soluong;
	}
	public int getGia() {
		return gia;
	}
	public void setGia(int gia) {
		this.gia = gia;
	}
	public Materials inputMaterials(){
		Scanner ip=new Scanner(System.in);
		System.out.println("=====Them moi Materials=====");
		System.out.println("Ngap ten Materials: ");
		String ten=ip.nextLine();
		while(ten.trim().equalsIgnoreCase("")){
			System.out.println("Chua nhap ten");
			ten=ip.nextLine();
		}
		System.out.println("Nhap loai Materials: ");
		String loai=ip.nextLine();
		while(loai.trim().equalsIgnoreCase("")){
			System.out.println("Chua nhap loai");
			loai=ip.nextLine();
		}
		System.out.println("Nhap so luong Materials: ");
		soluong=Integer.parseInt(ip.nextLine());
		System.out.println("Nhap gia Materials: ");
		gia=Integer.parseInt(ip.nextLine());
		Materials mr=new Materials(ten,loai,soluong,gia);
		return mr;
		
	}
	public void display(Materials mr){
		System.out.println("ten Materials: "+mr.ten);
		System.out.println("loai Materials: "+mr.loai);
		System.out.println("So luong Materials: "+mr.soluong);
		System.out.println("Gia Materials: "+mr.gia );
	}


}
